from wall import *

class Direction(object):
    def __init__(self, name, dx, dy):
        self.name = name
        self.dx = dx
        self.dy = dy

    def from_cell(self, x, y):
        return (x+self.dx, y+self.dy)

    def opposite(self):
        return self.opp

    def __str__(self):
        return self.name

NORTH = Direction("North", 0, -1)
WEST = Direction("West", -1, 0)
EAST = Direction("East", 1, 0)
SOUTH = Direction("South", 0, 1)

all_dirs = [NORTH, WEST, EAST, SOUTH]

NORTH.opp = SOUTH
SOUTH.opp = NORTH
WEST.opp = EAST
EAST.opp = WEST

del(Direction)

class Cell(object):
    def __init__(self):
        self.walls = {}
        self.walls[NORTH] = Wall()
        self.walls[WEST] = Wall()
        self.walls[EAST] = Wall()
        self.walls[SOUTH] = Wall()
    
    def can_go(self, direction):
        if self.walls[direction].state == EMPTY_WALL:
            return True
        else:
            return False

